package com.neusoft.service.impl;

import com.neusoft.mapper.OrderDeliveryMapper;
import com.neusoft.po.Orders;
import com.neusoft.service.DeliveryWorkerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeliveryWorkerServiceImpl implements DeliveryWorkerService {
	@Autowired
	private OrderDeliveryMapper orderDeliveryMapper;

	@Override
	public List<Orders> listOrders() {
		return orderDeliveryMapper.listOrders();
	}
	
	@Override
	public List<Orders> listAcceptOrders(String deliveryWorkerId) {
		return orderDeliveryMapper.listAcceptOrders(deliveryWorkerId);
	}

	@Override
	public Integer acceptOrder(int orderId, String workerId) {
		return orderDeliveryMapper.acceptOrder(orderId, workerId);
	}

	@Override
	public Integer deliverOrder(int orderId, String deliveryWorkerId) {
		return orderDeliveryMapper.deliverOrder(orderId, deliveryWorkerId);
	}
}
